/*
#include <math.h>
#include <algorithm>
#include <string>
#include <map>
#include <hash_map>
#include <set>
#include <vector>
#include <Stack>
#include <iostream>
#include <sstream>
using namespace std;
int minDistance(string word1, string word2) {
	vector<vector<int>>re;
	for(int i=0;i<word1.size()+1;i++){
		vector<int>tmp(word2.size()+1);
		re.push_back(tmp);
	}
	for(int k=0;k<word2.size()+1;k++)
		re[0][k]=k;
	for(int k=0;k<word1.size()+1;k++)
		re[k][0]=k;
	for(int i=1;i<=word1.size();i++){
		for(int k=1;k<=word2.size();k++){
			if(word1[i-1]==word2[k-1])
				re[i][k]=re[i-1][k-1];
			else{
				re[i][k]=min(min(re[i-1][k], re[i][k-1]), re[i-1][k-1]) + 1;  
			}
		}
	}
	return re[word1.size()][word2.size()];
}
int main(){
	cout<<minDistance("aa","bb");
	cout<<endl;
	system("pause");
	return 0;
}
*/